package cn.ctodb.divination.domain;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springframework.data.elasticsearch.annotations.Document;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * A Hzwx.
 */
@Entity
@Table(name = "hzwx")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "hzwx")
public class Hzwx implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "wh")
    private String wh;

    @Lob
    @Column(name = "hz")
    private String hz;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getWh() {
        return wh;
    }

    public Hzwx wh(String wh) {
        this.wh = wh;
        return this;
    }

    public void setWh(String wh) {
        this.wh = wh;
    }

    public String getHz() {
        return hz;
    }

    public Hzwx hz(String hz) {
        this.hz = hz;
        return this;
    }

    public void setHz(String hz) {
        this.hz = hz;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Hzwx hzwx = (Hzwx) o;
        if (hzwx.id == null || id == null) {
            return false;
        }
        return Objects.equals(id, hzwx.id);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "Hzwx{" +
            "id=" + id +
            ", wh='" + wh + "'" +
            ", hz='" + hz + "'" +
            '}';
    }
}
